import request from "@/utils/request";

// 查询客户列表
export function getList(params) {
  return request({
    url: "/system/customer/list",
    method: "get",
    params,
  });
}

// 获取客户来源大类
export function getCustomers() {
  return request({
    url: "/system/customers/list",
    method: "get",
  });
}

// 获取客户来源小类类
export function getCustomerSource(params) {
  return request({
    url: "/system/subcategory/list",
    method: "get",
    params,
  });
}

// 添加客户
export function customerAdd(data) {
  return request({
    url: "/system/customer/add",
    method: "post",
    data,
  });
}

// 修改客户
export function customerEdit(data) {
  return request({
    url: "/system/customer/edit",
    method: "post",
    data,
  });
}

// 详情
export function customerDetail(id) {
  return request({
    url: `/system/customer/${id}`,
    method: "get",
  });
}

// 添加追踪
export function addTracking(data) {
  return request({
    url: "/system/strack/add",
    method: "post",
    data,
  });
}

// 添加预约
export function addRecord(data) {
  return request({
    url: "/system/record/add",
    method: "post",
    data,
  });
}

// 删除预约
export function delRecord(ids) {
  return request({
    url: `/system/record/${ids}`,
    method: "delete",
  });
}

// 删除预约
export function delTracking(ids) {
  return request({
    url: `/system/strack/${ids}`,
    method: "delete",
  });
}

// 删除预约
export function assignCustomers(data) {
  return request({
    url: `/system/customer/allocationCustomer`,
    method: "post",
    data,
  });
}
